package com.king.edu.service.impl;

import com.king.edu.service.TPService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Random;

/**
 * @ClassName: TPServiceImpl
 * @Description: TODO
 * @Author: wangchangyong
 * @Date: 2020/6/8 21:50
 * @Version: 1.0.0
 **/
@Service(interfaceClass = TPService.class)
public class TPServiceImpl implements TPService {

    private static Logger logger = LoggerFactory.getLogger(TPServiceImpl.class);

    public static Random random = new Random();

    @Override
    public void methodA() {
        int i = random.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("methodB random = {}", i);
    }

    @Override
    public void methodB() {
        int i = random.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("methodB random = {}", i);
    }

    @Override
    public void methodC() {
        int i = random.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("methodB random = {}", i);
    }
}
